package cn.com.action;

import java.util.List;
import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import cn.com.biz.GuanLiYuanBiz;
import cn.com.biz.YiShengBiz;
import cn.com.entity.YiSheng;

import com.opensymphony.xwork2.ActionSupport;



public class YiShengAction extends ActionSupport implements SessionAware{
	Map<String, Object> session;
	
	public Map<String, Object> getSession() {
		return session;
	}

	public void setSession(Map<String, Object> arg0) {
		session=arg0;
		
	}
	private YiShengBiz ysBiz;
	private String uname;
	private String upwd;
	private int yishengid;
	private int keshiid;
	private String name;
	

	public int getYishengid() {
		return yishengid;
	}

	public void setYishengid(int yishengid) {
		this.yishengid = yishengid;
	}

	public int getKeshiid() {
		return keshiid;
	}

	public void setKeshiid(int keshiid) {
		this.keshiid = keshiid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUname() {
		return uname;
	}

	public void setUname(String uname) {
		this.uname = uname;
	}

	public String getUpwd() {
		return upwd;
	}

	public void setUpwd(String upwd) {
		this.upwd = upwd;
	}

	public YiShengBiz getYsBiz() {
		return ysBiz;
	}

	public void setYsBiz(YiShengBiz ysBiz) {
		this.ysBiz = ysBiz;
	}

	public String chakanyisheng(){
		List<YiSheng> yslist=ysBiz.chakanyisheng();
		if(yslist!=null){
			session.put("yslist", yslist);
			return SUCCESS;
		}else{
			return ERROR;
		}
	}
	public String insertyisheng(){
		boolean b=ysBiz.insertyisheng(yishengid, keshiid, name);
		if(b){
			return "tianjiachenggong";
		}else{
			return "tianjiashibai";
		}
	}
}
